package com.boarsoft.flow.service;

import com.boarsoft.flow.core.SimpleFlow;

/**
 * 为方便以服务形式暴露各个flow提供的接口<br>
 * 些接口返回的SimpleFlow对象来自远程，不可在本地运行，仅用于数据传递
 * 
 * @author Mac_J
 *
 */
public interface SimpleFlowService {
	/**
	 * 
	 * @param flow
	 * @return
	 * @throws Throwable
	 */
	SimpleFlow start(SimpleFlow flow) throws Throwable;

	/**
	 * 
	 * @param data
	 * @return
	 * @throws Throwable
	 */
	SimpleFlow start(Object data) throws Throwable;

	/**
	 * 
	 * @param id
	 * @return
	 * @throws Throwable
	 */
	SimpleFlow resume(String id) throws Throwable;

	/**
	 * 
	 * @param id
	 * @param exData
	 * @return
	 * @throws Throwable
	 */
	SimpleFlow resume(String id, Object exData) throws Throwable;

	/**
	 * 
	 * @return
	 * @throws Throwable
	 */
	SimpleFlow create() throws Throwable;
}
